package com.stox.client.ui.javafx.chartingy.model.chart;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Bounds;
import javafx.scene.layout.Pane;

public class GlassPane extends Pane {

	public GlassPane(final Chart<?, ?> chart) {
		chart.getChartContentArea().layoutBoundsProperty().addListener(new ChangeListener<Bounds>() {
			@Override
			public void changed(final ObservableValue<? extends Bounds> observable, final Bounds oldValue, final Bounds newValue) {
				setLayoutX(newValue.getMinX());
				setLayoutY(newValue.getMinY());
				setHeight(newValue.getHeight());
				setWidth(newValue.getWidth());
			}
		});

		setPickOnBounds(false);
	}

}
